home *** CD-ROM | disk | FTP | other *** search
- Copyright (c) 1991-1993 Borland International, Inc.
- All Rights Reserved.
-
- STREAMING OUTPUT IN BLADERUNNER
- -------------------------------
-
- This paper describes Bladerunner's streaming output commands
- and functions. It includes the ?, ?? and related commands;
- console, file and printer output devices; and configuration
- parameters.
-
- Bladerunner extends the dBASE IV stream printing mechanisms
- to allow access to Windows fonts and printers. Also,
- the mechanism allows for finer coordinate control.
-
- While this paper introduces printing concepts, it does not
- cover the File | Print menu command, or printing of GUI
- windows and objects.
-
- Contents
- --------
- I. Commands and Functions
- Proportional Fonts
- ANSI and OEM Fonts
- II. Printer System Memory Variables
- III. Configuration User Interface
-
- Commands and Functions
- ----------------------
-
- This section summarizes each command's or function's new
- behavior in Bladerunner.
-
- ?, ?? command
-
- Syntax:
-
- ??
- [<exp 1>
- [PICTURE <clause 1>]
- [FUNCTION <clause 2>]
- [AT <numExp>]]
- [STYLE <[<font number exp>]
- [<style option(s) exp>]]
- [,<exp 2>...[,...]]
-
- STYLE <exp> option
-
- The STYLE option is the same as the one in dBASE IV. The
- expression can be one of the following forms:
-
- ? STYLE 1
- ? STYLE "B"
- ? STYLE "2U"
-
- The letter in the parameter specifies one of the following
- character attributes:
-
- B - Bold
- I - Italic
- U - Underlined
- R - Raised (Superscript)
- L - Lowered (Subscript)
-
- The font number in the STYLE expression specifies the
- typeface to be used. The number refers to an entry in the
- [Fonts] section of the DBASEWIN.INI file that declares the
- font number and face. The [Fonts] section looks like this:
-
- [Fonts]
- 1=Times New Roman,12,ROMAN
- 2=Arial,10,SWISS
-
- The number is the font number that will be used in the STYLE
- command. Next is the font face name (from the Windows font
- selection dialog), followed by the point size and the font
- family. Any number from 1 to 32766 is a legal style number.
-
- A font can be in one of the following families: ROMAN,
- SWISS, MODERN, SCRIPT, or DECORATIVE. In the event the font
- named is not available on some output device, Windows
- chooses a font from the same family.
-
- Proportional Fonts
-
- Specifying a variable-pitch font subtly changes the meaning
- of some of the command's parameters. These are listed
- below. In general, though, where dBASE IV uses a number to
- specify a position or size in character units, the user may
- now specify fractional character values (that is, values
- with a decimal point, like 11.53). Existing code, which
- does not specify fractional units and does not use variable-
- pitch fonts, behaves exactly as before.
-
- When the user does not specify a style, a fixed-pitch font
- (usually Courier) will be selected. The _PPITCH memvar
- specifies the pitch (width) of the font.
-
- Fonts may vary in height as well. You can, for example,
- print a 10 point font and a 12 point font on the same line.
- In such cases, the height of the line is determined by the
- tallest font on the line.
-
- ANSI and OEM Fonts
-
- A font style can specify an ANSI or an OEM font. If Blade
- Runner's internal character set matches the font being used
- to display information, no translation is done. If the
- internal character set does not match the font's character
- set, the data is translated before being printed. This may
- cause certain graphics characters to print incorrectly.
-
- FUNCTION <expC> option
-
- The V option of the FUNCTION parameter accepts fractional
- units. For example, the user may now specify code like the
- following, to wrap the string in a column 15 1/2 characters
- wide.
-
- ? "This is a very long string that will wrap within the;
- column." FUNCTION "V15.5" STYLE 1
-
- This will print a string like the following:
-
- This is a very
- long string that
- will wrap within
- the column.
-
- The J and I (alignment) options will align printed output of
- variable-pitch strings. For example, the following code
- produces the centered output below.
-
- ? "This is a very long string that will wrap within the;
- column." FUNCTION "V15.5I" STYLE 1
-
- This is a very
- long string that
- will wrap within
- the column.
-
- AT <expN> option
-
- This option accepts a fractional number for the column
- position. For example:
-
- ? "This is a very long string that will wrap within the;
- column." FUNCTION "V15.5" STYLE 1 AT 15.5
-
- Displays the line indented :
-
- This is a very
- long string that
- will wrap within
- the column.
-
- ??? command
-
- Use of the ??? command in Bladerunner is not recommended.
- Direct printer control codes may not be supported by the
- Windows printer driver, and may cause output to behave
- unexpectedly. The ??? command was originally introduced to
- allow a user to produce graphical effects, like proportional
- fonts, that are already supported in Bladerunner. Therefore,
- it should not be necessary to use it.
-
- SET PRINTER TO command
-
- Syntax:
-
- SET PRINTER TO
- [<[FILE] <<filename> |?>> |
- <device 1> |
- \\CAPTURE |
- \\<computer name>\<printer name>=<device 2> |
- \\SPOOLER]
-
- The SET PRINTER TO command closes the current print document
- and begins a new print document on the specified device. If
- the device is a printer, Windows usually spools the output
- until the document is finished. If the device is a file,
- the resulting file can be copied to the printer port for
- printing. Because this output file contains binary codes,
- it is probably not human-readable.
-
- In Windows, printing is document-oriented. You open a
- printer document, output the pages you want to print, then
- close the document. In Bladerunner, you must issue a SET
- PRINTER TO <port> or SET PRINTER ON to open the document
- before you output text. To print the document, you close it
- by using the CLOSE PRINTER command, or SET PRINTER TO, which
- also resets the output device.
-
- When you output text for printing, the text is converted
- into print codes by the Windows printer driver, and fed to
- the Print Manager. The Print Manager then copies the print
- codes to the printer through the output port. The Print
- Manager handles normal printer problems (such as Out Of
- Paper), making it unnecessary for the dBASE programmer to
- handle these conditions.
-
- SET DEVICE TO command
-
- Syntax
-
- SET DEVICE TO SCREEN | PRINTER | FILE <filename|?>
-
- This command redirects @..SAY commands to the specified
- device. It can be used to print forms on paper.
-
- ON PAGE command
-
- Syntax:
-
- ON PAGE [AT LINE <expN>] <command block>
-
- This command can receive a fractional line number. The ON
- PAGE command block will be triggered when the current
- printing line is below or overlaps with the vertical
- coordinate specified in the AT LINE command.
-
- PRINTJOB/ENDPRINTJOB block
-
- This command closes the current print document and begins a
- new one, as if the user issued the CLOSE PRINTER command
- before the PRINTJOB block begins. When the ENDPRINTJOB
- block has finished executing, the print document is closed
- and printed, and a new one is begun.
-
- CHOOSEPRINTER() function
-
- Syntax:
-
- CHOOSEPRINTER( [<title: expC>] )
-
- This function displays the normal Windows Printer Setup
- dialog box. The user then may select a printer or change
- the printer settings. If the user presses the OK button to
- accept the changes, the function returns TRUE, and the value
- of the following settings and system memvars are changed:
-
- SET PRINTER TO
- _PDRIVER
- _PLENGTH
- _PORIENTATION
- _PCOPIES
- _PBPAGE
- _PEPAGE
- _PQUALITY
-
- If the user presses CANCEL, the function returns FALSE and
- nothing is changed.
-
- PRINTSTATUS() function
-
- Syntax
-
- PRINTSTATUS([<expC>])
-
- This function returns TRUE if the current printer is
- operating. Use <expC> to specify a different port to check
- Because printer output in Windows is buffered by the Print
- Manager, the PRINTSTATUS() function usually only returns
- FALSE if there is not enough disk space or memory to spool
- the output file. Other errors, such as out of paper, are
- handled directly by the Print Manager.
-
- If the printer port is not the port specified with SET
- PRINTER TO port, PRINTSTATUS() returns FALSE.
-
- PCOL() and PROW() functions
-
- These functions can return fractional values for the printer
- head location.
-
- DEFINE BOX
-
- This command is supported for compatibility, but is not as
- useful as the graphical printing commands.
-
- Printer System Memory Variables
- -------------------------------
-
- The following system memvars behave differently in
- Bladerunner:
-
- _BOX
-
- This memvar is still supported for compatibility, but is not
- as useful as the drawing commands.
-
- _PDRIVER
-
- The _PDRIVER variable can be assigned a string like the
- following:
-
- _PDRIVER = "HPPCL, PCL / HP LaserJet II"
-
- The string has two comma-separated parts. The first part is
- the file name of the print driver; the second part specifies
- the name of the printer. Because a Windows printer driver
- may support more than one printer type, the user must
- provide the printer type in the _PDRIVER setting. dBASE IV
- values are not permitted.
-
- _PCOLNO, __PLINENO, __PLOFFSET, __PLENGTH, __PLINENO, _TABS,
-
- These memvars can have fractional values.
-
- _PSPACING
-
- This memvar can have a fractional value. In Bladerunner,
- the paragraph spacing is in multiples of the height of the
- line just printed, which depends on the font(s) used to
- print the line.
-
- _PPITCH
-
- This memvar determines the size of the default output font.
- It also determines the size of a horizontal coordinate. For
- example,
-
- _ppitch = "PICA"
- ? "Hi there" AT 10
-
- prints the string one inch from the left margin. However,
- the following code
-
- _ppitch = "ELITE"
- ? "Hi there" AT 10
-
- prints the string 10/12 of an inch from the left margin.
- Line height is not affected by the pitch of the font.
-
- _PSCODE, _PECODE
-
- Use of these memvars is not recommended for the same reason
- as the ??? command.
-
- _PFORM
-
- dBASE IV .PRF files will still work, but the driver name
- will be ignored. The SAVE PFORM TO command in Bladerunner
- will save the file in a different format.
-
- _PORIENTATION
-
- Syntax:
-
- _PORIENTATION = "PORTRAIT" | "LANDSCAPE"
-
- This is a new memvar that controls the orientation of the
- paper in the printer. The change takes effect when the next
- print document is started, usually in the SET PRINTER TO
- command.
-
- _WRAP, _ALIGNMENT, _INDENT, _LMARGIN, _RMARGIN
-
- These memvars operate when _WRAP is TRUE. Bladerunner
- correctly does word wrapping even when printing with
- proportional fonts.
-
- When printing to several devices, each device may have
- different word wrapping rules. For example, the console and
- alternate file outputs are character-oriented devices, but
- the printer is a pixel-oriented device. With a proportional
- font, a different number of characters may fit on one line.
- In this case, the printer is considered the driving device,
- and the same number of characters will be output to the
- screen as the printer. Output to the screen may appear
- ragged, but the same text appears on the same line in both
- devices.
-
- Mixing _WRAP output with FUNCTION "V" or memo-field output
- can cause different results than in dBASE IV.
-
- Configuration User Interface
- ----------------------------
-
- The .INI settings can be changed by using the Properties |
- Printer Fonts dialog box. The dialog box allows the user to
- enter a font number, and then choose a typeface to be
- associated with the font number. This information is stored
- in the DBASEWIN.INI [Fonts] section.
-